package com.chujian.core.entity;

import com.baomidou.mybatisplus.annotation.KeySequence;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.chujian.framework.core.IId;
import com.chujian.framework.core.base.BaseEntity;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

import java.io.Serializable;
import java.util.HashMap;
import java.util.Map;


/**
 * app表
 *
 * @author chujian
 * @since 2021-07-28
 */
@Data
@EqualsAndHashCode(callSuper = true)
@Accessors(chain = true)
@TableName("core_app")
@KeySequence("core_app_seq")
public class CoreApp extends BaseEntity implements IId {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "appId")
    @TableId("app_id")
    private Long appId;

    @ApiModelProperty(value = "appId")
    @TableField("app_key")
    private String appKey;

    @ApiModelProperty(value = "appSecret")
    @TableField("app_secret")
    private String appSecret;

    @ApiModelProperty(value = "app名称")
    @TableField("app_name")
    private String appName;


    @ApiModelProperty(value = "拓展json")
    @TableField("ext_json")
    private String extJson;


    @ApiModelProperty(value = "账套id")
    @TableField("ac_id")
    private Long acId;


    @ApiModelProperty(value = "产品id")
    @TableField("prod_id")
    private Long prodId;


    // ++++++ 系统拓展 +++++++
    @TableField(exist = false)
    private Map<String, String> query = new HashMap<>();

    @Override
    public Long getId() {
        return this.appId;
    }

    @Override
    public void setId(Serializable id) {
        if (null != id) {
            this.appId = Long.parseLong("" + id);
        }
    }

    // ++++++ 业务拓展 +++++++
}
